package org.papillion39.sechelper.application.business.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;

/**
 *
 * @author Jonathan Paz <jonathan.paz@ottr.com>
 */
public class Recipient implements Serializable {

    private String firstName;
    private String middleName;
    private String lastName;
    private String email;
    private String streetAddress1;
    private String streetAddress2;
    private String streetAddress3;
    private String city;
    private String state;
    private String zipCode;
    private boolean emailPreferred;
    private final PropertyChangeSupport support = new PropertyChangeSupport(this);

    public Recipient() {
    }

    public Recipient(String firstName, String middleName, String lastName, String email, String streetAddress1, String streetAddress2, String streetAddress3, String city, String state, String zipCode, boolean emailPreferred) {
        this.firstName = firstName;
        this.middleName = middleName;
        this.lastName = lastName;
        this.email = email;
        this.streetAddress1 = streetAddress1;
        this.streetAddress2 = streetAddress2;
        this.streetAddress3 = streetAddress3;
        this.city = city;
        this.state = state;
        this.zipCode = zipCode;
        this.emailPreferred = emailPreferred;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        String oldfirstName = this.firstName;
        this.firstName = firstName;
        support.firePropertyChange("firstName", oldfirstName, firstName);
    }

    public String getMiddleName() {
        return middleName;
    }

    public void setMiddleName(String middleName) {
        String oldmiddleName = this.middleName;
        this.middleName = middleName;
        support.firePropertyChange("middleName", oldmiddleName, middleName);
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        String oldlastName = this.lastName;
        this.lastName = lastName;
        support.firePropertyChange("lastName", oldlastName, lastName);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        String oldemail = this.email;
        this.email = email;
        support.firePropertyChange("email", oldemail, email);
    }

    public String getStreetAddress1() {
        return streetAddress1;
    }

    public void setStreetAddress1(String streetAddress1) {
        String oldstreetAddress1 = this.streetAddress1;
        this.streetAddress1 = streetAddress1;
        support.firePropertyChange("streetAddress1", oldstreetAddress1, streetAddress1);
    }

    public String getStreetAddress2() {
        return streetAddress2;
    }

    public void setStreetAddress2(String streetAddress2) {
        String oldstreetAddress2 = this.streetAddress2;
        this.streetAddress2 = streetAddress2;
        support.firePropertyChange("streetAddress2", oldstreetAddress2, streetAddress2);
    }

    public String getStreetAddress3() {
        return streetAddress3;
    }

    public void setStreetAddress3(String streetAddress3) {
        String oldstreetAddress3 = this.streetAddress3;
        this.streetAddress3 = streetAddress3;
        support.firePropertyChange("streetAddress3", oldstreetAddress3, streetAddress3);
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        String oldcity = this.city;
        this.city = city;
        support.firePropertyChange("city", oldcity, city);
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        String oldstate = this.state;
        this.state = state;
        support.firePropertyChange("state", oldstate, state);
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        String oldzipCode = this.zipCode;
        this.zipCode = zipCode;
        support.firePropertyChange("zipCode", oldzipCode, zipCode);
    }

    public boolean isEmailPreferred() {
        return emailPreferred;
    }

    public void setEmailPreferred(boolean emailPreferred) {
        boolean oldemailPreferred = this.emailPreferred;
        this.emailPreferred = emailPreferred;
        support.firePropertyChange("emailPreferred", oldemailPreferred, emailPreferred);
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        support.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        support.removePropertyChangeListener(listener);
    }

    public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
        support.addPropertyChangeListener(propertyName, listener);
    }

    public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
        support.removePropertyChangeListener(propertyName, listener);
    }
}
